Documentation for Users  1.0.2
Perception Toolbox for Virtual Reality (PTVR) Manual
Placing objects after coordinate transformations

Goal

It is often very convenient for scientists to apply some coordinate transformations before placing objects in 3D.

However, coordinate transformations can be sometimes painful for non-mathematicians. PTVR offers some features whose aim is to reduce such pain for several common experimental situations as detailed in the present page.

Figure 1: 'Simple derivation of the Lorentz transformation by improvement of the intuitive Voigt transformation'. (😉Verbatim from Mattcomm, CC BY-SA 4.0, via Wikimedia Commons).

Translations and Rotations

PTVR provides functions to easily perform translations and rotations of coordinate systems in the following way (translations and rotations are part of rigid transformations - see Definitions below):

At any moment in a PTVR script, there is a CURRENT coordinate system that is used by all subsequent relevant fonctions. This CURRENT coordinate system (say CS1) is used until a new rigid transformation is applied, thus leading to a new coordinate system (say CS2) that becomes the current coordinate system..

At the beginning of the script, the CURRENT coordinate system is the GLOBAL coordinate system (aka World coordinate system).

😎 Tip: you can come back to the GLOBAL coordinate system at any moment with : my_experiment.reset_coordinate_system()


PTVR functions to apply these coordinate transformations

There are two kinds of PTVR functions to create a NEW coordinate system as detailed in the two following sub-sections:

1/ functions that use the GLOBAL coordinate system (aka World coordinate system) to define the coordinates of the transformation vector (translation or rotation) and to apply the transformation.

2/ functions that use the CURRENT coordinate system to define the coordinates of the transformation vector (translation or rotation) and to apply the transformation.


😎 Reminder: If you need an extensive summary of relevant information on coordinate transformations, do not forget the helpful 'coordinate transformations' cheatsheet.



Pointers


Definitions

... rigid transformations include rotations, translations, reflections, or any sequence of these. Reflections are sometimes excluded from the definition of a rigid transformation by requiring that the transformation also preserve the handedness of objects in the Euclidean space. (A reflection would not preserve handedness; for instance, it would transform a left hand into a right hand.) ....
Any object will keep the same shape and size after a proper rigid transformation.
(Wikipedia contributors, 'Rigid transformation').



Figure 2: A translation moves every point of a figure or a space by the same amount in a given direction. Image from Fred the Oyster, CC BY-SA 4.0, via Wikimedia Commons.

Figure 3: An xy-Cartesian coordinate system rotated through an angle theta to an x′y′-Cartesian coordinate system. Image from Guy vandegrift, CC BY-SA 3.0, via Wikimedia Commons.


Demos

Several scripts in: PTVR_Researchers\Python_Scripts\Demos\Coordinate_Systems\

Several scripts in: PTVR_Researchers\Python_Scripts\Demos\Screens\